import { createApp } from 'vue'
import App from './App.vue'
import router from '@/router/index'
import store from './store'
import moment from 'moment' // 时间格式化


// import LingRui from 'lingrui-vue3'

import 'vite-plugin-svg-icons/register';
import svgIcon from './components/SvgIcon/index.vue' // 全局svg图标组件

import { ElMessage, ElMessageBox } from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementIcon from '@element-plus/icons'

import * as echarts from 'echarts'

import api from '@/utils/api'


import '@/styles/index.scss' // global css
import '@/permission' // permission control

import drag from '@/directive/el-drag-dialog/drag'

const app = createApp(App)

app.config.globalProperties.$moment = moment
app.config.globalProperties.$api = api
app.config.globalProperties.$echarts = echarts
app.config.globalProperties.$msgbox = ElMessageBox
app.config.globalProperties.$message = ElMessage

app.directive('el-drag-dialog', drag)
app.component('svg-icon', svgIcon)

for(const icon in ElementIcon) {
    app.component(icon, ElementIcon[icon])
  }
// app.use(ElementPlus, { size: 'default', zIndex: 3000, locale: zhCn })
// app.use(LingRui)
app.use(router)
app.use(store)
// app.component('cyTable',headline)
app.mount('#app')

